<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='global-property-'>/**
</span> * @ignore
 * control for overlay
 * @author yiminghe@gmail.com
 */
KISSY.add(&quot;overlay/control&quot;, function (S, Container,Shim, AlignExtension,
                                    Loading, Mask, OverlayRender, OverlayEffect) {

    var HIDE = &quot;hide&quot;,
        actions = {
            hide: HIDE,
            destroy: &quot;destroy&quot;
        };
<span id='KISSY-Overlay'>    /**
</span>     * KISSY Overlay Component.
     * xclass: 'overlay'.
     * @class KISSY.Overlay
     * @extends KISSY.Component.Container
     * @mixins KISSY.Component.Extension.Shim
     * @mixins KISSY.Overlay.Extension.Effect
     * @mixins KISSY.Overlay.Extension.Loading
     * @mixins KISSY.Component.Extension.Align
     * @mixins KISSY.Overlay.Extension.Mask
     */
    return Container.extend([
        Shim,
        Loading,
        AlignExtension,
        Mask,
        OverlayEffect
    ], {
        bindUI: function () {
            var self = this,
                closeBtn = self.get(&quot;closeBtn&quot;);
            if (closeBtn) {
                closeBtn.on(&quot;click&quot;, function (ev) {
                    self.close();
                    ev.preventDefault();
                });
            }
        },
<span id='KISSY-Overlay-method-close'>        /**
</span>         * hide or destroy according to {@link KISSY.Overlay#closeAction}
         * @chainable
         */
        close: function () {
            var self = this;
            self[actions[self.get(&quot;closeAction&quot;)] || HIDE]();
            return self;
        }
    }, {
        ATTRS: {

            contentEl: {
            },

<span id='KISSY-Overlay-cfg-closable'>            /**
</span>             * Whether close button is visible.
             *
             * Defaults to: true.
             *
             * @cfg {Boolean} closable
             */
<span id='KISSY-Overlay-property-closable'>            /**
</span>             * Whether close button is visible.
             * @type {Boolean}
             * @property closable
             */
<span id='global-property-closable'>            /**
</span>             * @ignore
             */
            closable: {
                value: false,
                view: 1
            },

<span id='KISSY-Overlay-property-closeBtn'>            /**
</span>             * close button element.
             * @type {KISSY.NodeList}
             * @property closeBtn
             * @readonly
             */
<span id='global-property-closeBtn'>            /**
</span>             * @ignore
             */
            closeBtn: {
                view: 1
            },

<span id='KISSY-Overlay-cfg-closeAction'>            /**
</span>             * Whether to destroy or hide current element when click close button.
             * Can set &quot;destroy&quot; to destroy it when click close button.
             *
             * Defaults to: &quot;hide&quot;.
             *
             * @cfg {String} closeAction
             */
<span id='global-property-closeAction'>            /**
</span>             * @ignore
             */
            closeAction: {
                value: HIDE
            },

<span id='KISSY-Overlay-cfg-focusable'>            /**
</span>             * overlay can not have focus.
             *
             * Defaults to: false.
             *
             * @cfg {Boolean} focusable
             * @protected
             */
<span id='global-property-focusable'>            /**
</span>             * @ignore
             */
            focusable: {
                value: false
            },

<span id='KISSY-Overlay-cfg-allowTextSelection'>            /**
</span>             * overlay can have text selection.
             *
             * Defaults to: true.
             *
             * @cfg {Boolean} allowTextSelection
             * @protected
             */
<span id='global-property-allowTextSelection'>            /**
</span>             * @ignore
             */
            allowTextSelection: {
                value: true
            },

<span id='KISSY-Overlay-cfg-handleMouseEvents'>            /**
</span>             * whether this component can be responsive to mouse.
             *
             * Defaults to: false
             *
             * @cfg {Boolean} handleMouseEvents
             * @protected
             */
<span id='global-property-handleMouseEvents'>            /**
</span>             * @ignore
             */
            handleMouseEvents: {
                value: false
            },

            visible: {
                value: false
            },

            xrender: {
                value: OverlayRender
            }
        },
        xclass: 'overlay'
    });
}, {
    requires: [
        'component/container',
        'component/extension/shim',
        'component/extension/align',
        &quot;./extension/loading&quot;,
        &quot;./extension/mask&quot;,
        './overlay-render',
        './extension/overlay-effect'
    ]
});</pre>
</body>
</html>
